<% if false # the license inside this if block pertains to this file -%>
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
<% end -%>
<%
  api_name_lower = product_ns.downcase
  resource_name = Google::StringUtils.underscore(object.name + "_" + object.version.upcase)
  properties = object.all_user_properties
-%>
---
<%#= lines(autogen_notice :yaml) -%>
layout: "<%= package %>"
page_title: "<%= cloud_name %>: <%= package %>_<%= api_name_lower -%>_<%= resource_name -%>"
sidebar_current: "docs-<%= package %>-resource-<%= api_name_lower -%>-<%= resource_name.gsub("_", "-") -%>"
description: |-
<%= indent(Google::StringUtils.first_sentence(object.description), 2) %>
---

# <%= package %>\_<%= api_name_lower -%>\_<%= resource_name.gsub("_", "\\_") %>

<%= lines(object.description) -%>
<% if !object.references.nil? -%>

To get more information about <%= object.name -%>, see:

<%   if !object.references.api.nil? -%>
* [API documentation](<%= object.references.api -%>)
<%   end # object...api.nil? -%>
<%   if !object.references.guides.nil? -%>
* How-to Guides
<%     object.references.guides.each do |title, link| -%>
    * [<%= title -%>](<%= link -%>)
<%     end # object...guides.each -%>
<%   end # object...guides.nil? -%>
<% end # object...api.nil? -%>
<% unless object.examples.nil? -%>

## Example Usage
<%   object.examples.each do |example| -%>

### <%= example.description %>

<%= example.config_documentation(product_folder) -%>
<%   end -%>
<% end -%>

## Argument Reference

The following arguments are supported:
<% ps = order_properties(properties.reject(&:output)) -%>
<% ps.each do |prop| -%>
<%= lines(build_property_documentation(prop)) -%>
<% end -%>
<% #unless ps.find_index {|prop| !prop.child_properties.nil? }.nil? -%>
<% #- - - -%>
<% #end -%>
<% ps.each do |prop| -%>
<%= lines(build_nested_property_documentation(prop)) -%>
<% end -%>
<% # properties.reject(&:required).reject(&:output).sort_by(&:out_name).each do |prop| -%>
<% #= lines(build_property_documentation(prop)) -%>
<% # end -%>
<% # properties.reject(&:required).reject(&:output).sort_by(&:out_name).each do |prop| -%>
<% # = lines(build_nested_property_documentation(prop)) -%>
<% # end -%>
<% ps = properties.select(&:output).sort_by(&:out_name) -%>
<% unless ps.empty? -%>

## Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:
<%   ps.each do |prop| -%>
<%= lines(build_property_documentation(prop)) -%>
<%   end -%>
<%   ps.each do |prop| -%>
<%= lines(build_nested_property_documentation(prop)) -%>
<%   end -%>
<% end -%>
<% at = async_timout(object) %>
<% unless at.empty? -%>
## Timeouts

This resource provides the following timeouts configuration options:
<%   unless at["create"].nil? -%>
- `create` - Default is <%= sprintf('%d', at["create"] / 60) -%> minute.
<%   end -%>
<%   unless at["update"].nil? -%>
- `update` - Default is <%= sprintf('%d', at["update"] / 60) -%> minute.
<%   end -%>
<%   unless at["delete"].nil? -%>
- `delete` - Default is <%= sprintf('%d', at["delete"] / 60) -%> minute.
<%   end -%>

<% end -%>
<% if import_resource?(object) -%>
## Import

<%= object.name -%> can be imported using the following format:

```
$ terraform import <%= package %>_<%= api_name_lower -%>_<%= resource_name -%>.default {{ resource id}}
```
<% end -%>
